package com.yan.iftest;

import java.util.Scanner;

public class Test4 {
    public static void main(String[] args) {
        // 定义用户类别,购物金额
        int customer,amount;
        Scanner input = new Scanner(System.in);
        System.out.println("输入顾客种类（0为普通顾客,1为会员）");
        customer = input.nextInt();
        System.out.println("输入购物金额");
        amount = input.nextInt();
        // 定义折后金额
        double reducedAmount;
        // 计算应付金额
        if(customer == 0){
            if(amount >= 100){
                reducedAmount = amount * 0.9;
                System.out.println("应付金额为：" + reducedAmount);
            }else {
                System.out.println("应付金额为：" + amount);
            }
        }else {
            if(amount >= 200){
                reducedAmount = amount * 0.75;
                System.out.println("应付金额为：" + reducedAmount);
            }else {
                reducedAmount = amount * 0.8;
                System.out.println("应付金额为：" + reducedAmount);
            }
        }
    }
}
